﻿class DefaultCellTest extends tsUnit.TestClass {

    grid: FakeGrid;

    setUp() {
        this.grid = new FakeGrid(3, 3, CellState.Dead, CellState.Dead, CellState.Dead, CellState.Dead, CellState.Dead, CellState.Dead, CellState.Alive, CellState.Alive, CellState.Alive);


    }
    CheckTheSetup() {
        this.areIdentical(this.grid.GetNrOfCellsOfState(CellState.Alive), 3);
        this.isTrue(this.grid.GetCell(1, 1).State == CellState.Dead);

    }

    tearDown() {
        delete this.grid;
    }

    IterateOnceAndCheckForLife() {
        this.grid.GenerateContent();
        this.isTrue(this.grid.GetCell(1, 1).State == CellState.Alive);

    }

    IterateTwiceAndCheckForLife() {
        this.grid.GenerateContent();
        this.grid.GenerateContent();
        this.isTrue(this.grid.GetCell(1, 1).State == CellState.Alive);

    }

}


 